package com.zat.mes.andrmes.dofun.work

import android.view.View
import com.zat.mes.andrmes.R
import com.zat.mes.andrmes.base.BaseActivity
import com.zat.mes.andrmes.dofun.work.fragment.DayProducePlanFragment
import com.zat.mes.andrmes.global.CompanionType
import kotlinx.android.synthetic.main.layout_title.*

/**
 * 做工日计划activityu
 */
class DayProducePlanListActivity : BaseActivity() {

    private var empName: String = ""
    var day: String = ""
    private var empId: Long = 0
    override fun init() {
        initView()
        initData()
    }

    /**
     * 初始化数据
     */
    private fun initData() {
        day = intent.getStringExtra(CompanionType.INTENT_EXTRA_DAY)
        empId = intent.getLongExtra(CompanionType.INTENT_EXTRA_EMPID, 0)
        empName = intent.getStringExtra(CompanionType.INTENT_EXTRA_EMPNAME)
        tVtitle.text = empName
        val beginTransaction = supportFragmentManager.beginTransaction()
        beginTransaction.add(R.id.flContentDp, DayProducePlanFragment.newInstance(empId)).commit()
    }

    /**
     * 初始化view
     */
    private fun initView() {
        setContentView(R.layout.activity_day_produce_plan_list)
        tVtitle.visibility = View.GONE
        rlRight.visibility = View.INVISIBLE
        rlReturnTitle.setOnClickListener { finish() }
    }


}
